//
//  WashPriceCell.m
//  carowner
//
//  Created by apple on 2019/5/24.
//  Copyright © 2019 ggj. All rights reserved.
//

#import "WashPriceCell.h"

@implementation WashPriceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        
        _projectName = [[UILabel alloc] init];
        _projectName.font = textFont;
        _projectName.numberOfLines = 2;
        _projectName.textAlignment = NSTextAlignmentCenter;
        
        _tvTime = [[UILabel alloc] init];
        _tvTime.textColor = tab_unselect_color;
        _tvTime.font = textFont;
        _tvTime.textAlignment = NSTextAlignmentCenter;
        
        _priceTip = [[UILabel alloc] init];
        _priceTip.text = @"价格";
        _priceTip.font = textFont;
        _priceTip.textAlignment = NSTextAlignmentCenter;
    
        _tvPrice = [[UILabel alloc] init];
        _tvPrice.text = @"¥0";
        _tvPrice.font = textFont;
        _tvPrice.textColor = color2;
        _tvPrice.textAlignment = NSTextAlignmentCenter;
        
        UIView * vLine = [NSObject getLineView];
        UIView * hLine = [NSObject getLineView];
        
        [self addSubview:_projectName];
        [self addSubview:_tvTime];
        [self addSubview:_priceTip];
        [self addSubview:_tvPrice];
        [self addSubview:vLine];
        [self addSubview:hLine];
        
        
        [vLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.equalTo(self);
            make.centerX.equalTo(self);
            make.width.mas_equalTo(1);
        }];
        
        [_projectName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(20);
            make.top.equalTo(self).offset(15);
            make.right.equalTo(vLine.mas_left).offset(-20);
        }];
        
        
        [_tvTime mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self);
            make.bottom.equalTo(self).offset(-15);
            make.right.equalTo(vLine.mas_left);
        }];
        
        [_priceTip mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self);
            make.top.equalTo(self).offset(15);
            make.left.equalTo(vLine.mas_right);
        }];
        
        [_tvPrice mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self);
            make.bottom.equalTo(self).offset(-15);
            make.left.equalTo(vLine.mas_right);
        }];
        
        [hLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(kScreen_Width, 1));
            make.left.right.equalTo(self);
            make.bottom.equalTo(self);
        }];
        
        
    }
    return self;
}

@end
